<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Session_start();
/**
 * serialize($data); //ma hoa 1 mang
 * unserialize($text_serialize);//giai ma
 * is_object()
 */
class CI_Session{
    function set_userdata($param1,$param2){
        if(is_array($param2) or is_object($param2) ){
          $param2 =   serialize($param2);
        }
        $_SESSION[$param1] = $param2;
    }
    function userdata($param1){
        if(!empty($_SESSION[$param1])){
            $param2 = $_SESSION[$param1];
            if(is_array(@unserialize($param2)) or is_object(@unserialize($param2))){
                return unserialize($param2);
            }else{
                return $param2;
            }
        }else{
            return false;
        }
        
        
    }
    function unset_userdata($param1){
      
        $_SESSION[$param1] = '';
        
    }
    


}
// END Session Class

/* End of file Session.php */
/* Location: ./system/libraries/Session.php */